-
-
Notifications
You must be signed in to change notification settings - Fork 34
docs: Add ARCHITECTURE.md with diagram of components #615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
cliffmccarthy
commented
Aug 11, 2025
- For starters, this file is just a diagram of components of a chatmail server. In the future, this document can grow into a more complete description of the architecture of the server, the deployment process, and the design intent behind what is and isn't in the code base.
- The name ARCHITECTURE.md is inspired by this article, which also has good suggestions about what to put in the file: https://matklad.github.io/2021/02/06/ARCHITECTURE.md.html
The current revision is a rough draft, and will probably be revised further as I study the code more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good as a start. thanks!
ARCHITECTURE.md
Outdated
@@ -0,0 +1,37 @@ | |||
This diagram shows components of the chatmail server: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please qualify this sentence that's it's a draft overview as of mid August 2025.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review! I updated the text as you suggested. I also added labels to some of the arrows to indicate the ports and sockets that the components communicate by.
- For starters, this file is just a diagram of components of a chatmail server. In the future, this document can grow into a more complete description of the architecture of the server, the deployment process, and the design intent behind what is and isn't in the code base. - The name ARCHITECTURE.md is inspired by this article, which also has good suggestions about what to put in the file: https://matklad.github.io/2021/02/06/ARCHITECTURE.md.html
- Suggested in review by hpk42.
c0f630f
to
0c1adff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great start, the only missing things I can think of are opendkim and the lastlogin service, but we can also merge it as it is and add them later :)
I added some suggestions, which would make more sense for me - but as this diagram is not so I can understand it, but for newcomers, I'd leave it to you which you want to adapt :)
For others looking at this, a preview is at https://github.com/cliffmccarthy/chatmail-relay/blob/architecture-doc/ARCHITECTURE.md
ARCHITECTURE.md
Outdated
chatmail-metrics --> /var/www/html; | ||
acmetool --> certs; | ||
acmetool --> acmetool-redirector; | ||
acmetool-redirector --> certs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
acmetool-redirector --> certs; | |
acmetool-redirector --> nginx; |
I would argue that acmetool-redirector doesn't actually have much to do with certs, and mostly just redirects traffic to nginx?
ARCHITECTURE.md
Outdated
acmetool --> certs; | ||
acmetool --> acmetool-redirector; | ||
acmetool-redirector --> certs; | ||
nginx --> /var/www/html; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nginx --> /var/www/html; | |
nginx --> |8443|/var/www/html; |
We could include that port 8443 is needed to show the webroot directory :)
ARCHITECTURE.md
Outdated
acmetool-redirector --> certs; | ||
nginx --> /var/www/html; | ||
nginx --> certs; | ||
nginx --> newemail.py; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nginx --> newemail.py; | |
nginx --> |8443|newemail.py; |
same for newemail.py :)
ARCHITECTURE.md
Outdated
acmetool --> acmetool-redirector; | ||
acmetool-redirector --> certs; | ||
nginx --> /var/www/html; | ||
nginx --> certs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nginx --> certs; | |
certs --> nginx; |
And one could argue that nginx is dependent on the certs, not the other way round.
ARCHITECTURE.md
Outdated
nginx --> |993|dovecot; | ||
autoconfig.xml --> postfix; | ||
autoconfig.xml --> dovecot; | ||
postfix --> certs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
postfix --> certs; | |
certs --> postfix; |
same for postfix...
ARCHITECTURE.md
Outdated
postfix --> |10080,10081|filtermail; | ||
postfix --> echobot; | ||
postfix --> |doveauth.socket|doveauth; | ||
dovecot --> certs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dovecot --> certs; | |
certs --> dovecot; |
...and dovecot ;)
ARCHITECTURE.md
Outdated
cron --> acmetool; | ||
cron --> chatmail-metrics; | ||
chatmail-metrics --> /var/www/html; | ||
acmetool --> certs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
acmetool --> certs; | |
acmetool --> /var/lib/acme; |
For /home/vmail
and /var/www/html
we also talk about the path, because they contain state... we could do that for the certs as well :) that would make it clearer what to backup/manage. maybe TLS certs /var/lib/acme
, Users /home/vmail
, and Website /var/www/html
? That would make it more obvious what the paths contain.
Let me know what changes you want to include, then I'll merge this :) |
Thanks for all the review feedback! I will submit a new revision in the next day or two. |
- Implemented changes suggested in review by missytake: - Removed relation between acmetool-redirector and certs. - Added internal nginx listening on port 8443. - Changed direction of arrows between certs and the services that use them. This makes the arrow show the direction of information flow, rather than a "depends on" relation. - For filesystem paths, added a descriptive name to the node. - Replaced most arrows with plain lines, to simply show that a relationship exists between the two nodes. This also reduces visual clutter, since the graph is pretty dense with information already. - Split nginx and certs into two nodes, to reduce entanglement in the graph. These "linked" nodes are given a different shape and filled with a different colour, to highlight the fact that they are the same node. - Revised text about the meaning of edges in the graph.
I tried to incorporate all your suggestions in the latest revision. This isn't perfect, but it's starting to push the limits of what can be reasonably expressed in a mermaid diagram. I'm open to any suggestions about better colours for the duplicated nodes. I do want to incorporate opendkim and lastlogin, but that will probably jumble the layout again, leading to another round of graph-hacking. I'll take that up in another revision (possibly in this PR if it's still open when I get to it). Here are the details from the latest commit message:
|
Thanks, let's merge this for now :) I also have some ideas, which go more into the direction of "depending on" than "information flow" actually. Might open a PR about it :) |